<!DOCTYPE HTML><html>
<head>
<? echo $h->meta($title, $kwd, $dpn); ?>
<? require_once("lib.php"); ?>
<script type="text/javascript" src="cart/js/jquery.jqzoom.js"></script>
</head>
<body>
<? include_once("header.php"); ?>
<div id="wrap">
	<div class="breadcrumb">
		<a href="./"><?=WEB_INDEX_PAGE?></a> &gt; 
			<?
				$str='';
				foreach($cate_parents as $val){
					$str.='<a href="products-'.$val['id'].'.html">'.$val['name_'.$lang].'</a> &gt; ';
				}
				echo $str;
			?>
			<span><?=$item['name_'.$lang]?></span>
	</div><!--breadcrumb end-->
	<?
	$i=0;
	$str_smallpic='<div class="minphoto"><a data="0"><img src="'.PRODUCT_PIC_HOST.$item['small_pic'].'"/></a></div>';
	$str_bigpic='<div class="spec_n1 jqzoom big'.$i.'"><img width="350" height="350" src="'.PRODUCT_PIC_HOST.$item['large_pic'].'" jqimg="'.PRODUCT_PIC_HOST.$item['large_pic'].'" class="bigImg2" /></div>';
	foreach($product_pic_obj as $row){
		$i++;
		$str_bigpic.='<div class="spec_n1 jqzoom hide big'.$i.'"><img width="350" height="350" src="'.PRODUCT_PIC_HOST.$row['large_pic'].'" jqimg="'.PRODUCT_PIC_HOST.$row['large_pic'].'" class="bigImg2" /></div>';
		$str_smallpic.='<div class="minphoto"><a data="'.$i.'"><img bigpic="'.PRODUCT_PIC_HOST.$row['large_pic'].'" src="'.PRODUCT_PIC_HOST.$row['small_pic'].'"/></a></div>';
	}
	?>
	<div id="product_intro">
		<div id="preview">
			<? echo $str_bigpic ?>
			<div id="spec_list">
				<div id="slide">
					 <div id="scrollable"><a class="prev"></a>
					 <div class="items" id="scroller">
					 <div class="scroller">
						<div id="scroll1">
						<? echo $str_smallpic ?>
						 </div>
					</div>
				       <br clear="all"/>
				       </div>
					<a  class="next"></a> </div>
		        	</div><!--slide-->
			</div><!--spec_list end-->
			
		</div><!--preivew end-->
		<div id="grid_middle">
			<div class="hide"><? echo $h->hidden('pid',$id,'pid'); ?></div>
			<div id="name">
				<h1><?=$item['name_'.$lang]?></h1>
				<strong><?//=$item['subtitle_'.$lang]?></strong>
			</div><!--name end-->
			<ul id="summary">
				<li><div class="dt"><?=WEB_PRODUCT_SKU?>：</div><div class="dd"><?=$item['sku']?></div></li>
				<li><div class="dt"><?=WEB_PRODUCT_PRICE?>：</div><div class="dd"><span class="pro_price"><?=$currency_sign?><span class="item_price"><?=$product_price.discount($item)?></span></span></div></li>
				<?if(is_module_enabled($option_module['product_review'])) {?>
					<li><div class="dt"><?=WEB_PRODUCT_RATING?>：</div><div class="dd"><em class="red">
					<?
					if($product_review_summary_obj['cnt']>0){
						echo "<img src=\"cart/images/stars_".round($product_review_summary_obj['avg_score'])."_small.gif\"/>";
						//echo round($product_review_summary_obj['avg_score'])." ";
					}
					else {
						echo WEB_PRODUCT_NO_RATING;
					}
					?>
					</em></div></li>
				<?}?>
				
				<li><div class="dt"><?=WEB_PRODUCT_VIEW_COUNT?>：</div><div class="dd"><em class="red"><?=$item['hit_count']?></em></div></li>
			</ul><!--summary end-->
			<ul id="choose">
				<?if(!empty($colorVariation)) {?>
				<li id="choose-color"><div class="dt"><?=$option_label[1]?>：</div>
				<div class="dd">
					<select name="variation_color" id="variation_color" onchange="option_change('color');">
					<option value="">-- <?=WEB_PLEASE_CHOOSE?> --</option>
					<?foreach($colorVariation as $key=>$value){?>
					<option value="<?=$key?>"><?=$value?></option>
					<?}?>
					</select>
					<div id="no_color" class='red hide'><?=WEB_PLEASE_CHOOSE?> <?=$option_label[1]?></div>
					<div class="clear"></div>
				</div>
				</li>
				<?}?>
				
				<?if(!empty($sizeVariation)) {?>
				<li id="choose-type"><div class="dt"><?=$option_label[2]?>：</div>
				<div class="dd">
					<select name="variation_size" id="variation_size" onchange="option_change('size');">
					<option value="">-- <?=WEB_PLEASE_CHOOSE?> --</option>
					<?foreach($sizeVariation as $key=>$value){?>
					<option value="<?=$key?>"><?=$value?></option>
					<?}?>
					</select>
					<div id="no_size" class='red hide'><?=WEB_PLEASE_CHOOSE?> <?=$option_label[2]?></div>
					<div class="clear"></div>
				</div>
				</li>
				<?}?>				

				<?if(!empty($other1Variation)) {?>
				<li id="choose-other1"><div class="dt"><?=$option_label[3]?>：</div>
				<div class="dd">
					<select name="variation_other1" id="variation_other1" onchange="option_change('other1');">
					<option value="">-- <?=WEB_PLEASE_CHOOSE?> --</option>
					<?foreach($other1Variation as $key=>$value){?>
					<option value="<?=$key?>"><?=$value?></option>
					<?}?>
					</select>
					<div id="no_other1" class='red hide'><?=WEB_PLEASE_CHOOSE?> <?=$option_label[3]?></div>
					<div class="clear"></div>
				</div>
				</li>
				<?}?>

				<?if(!empty($other2Variation)) {?>
				<li id="choose-other2"><div class="dt"><?=$option_label[4]?>：</div>
				<div class="dd">
					<select name="variation_other2" id="variation_other2" onchange="option_change('other2');">
					<option value="">-- <?=WEB_PLEASE_CHOOSE?> --</option>
					<?foreach($other2Variation as $key=>$value){?>
					<option value="<?=$key?>"><?=$value?></option>
					<?}?>
					</select>
					<div id="no_other2" class='red hide'><?=WEB_PLEASE_CHOOSE?> <?=$option_label[4]?></div>
					<div class="clear"></div>
				</div>
				</li>
				<?}
				?>
				<li id="choose-amount"><div class="dt"><?=WEB_PURCHASE_QUANTITY?>：</div>
				<div class="dd">
					<div class="wrap-input">
						<a class="btn-reduce" href="javascript:;" onclick="qty_reduce('buy-qty')"><?=WEB_QUANTITY_LESS?></a>
						<a class="btn-add" href="javascript:;" onclick="qty_add('buy-qty',<?=$max_buy?>)"><?=WEB_QUANTITY_ADD?></a>
						<input class="text" id="buy-qty" value="1" onkeyup="cart_quantity_check(<?=$max_buy?>);" />
						<input type="hidden" id="buy-pid" name="buy-pid" value="<?=$id?>" />
						<input type="hidden" id="buy-var" name="buy-var" value="0" />
						<input type="hidden" id="color_oid" name="color_oid" value="0" />
						<input type="hidden" id="size_oid" name="size_oid" value="0" />
						<input type="hidden" id="other1_oid" name="other1_oid" value="0" />
						<input type="hidden" id="other2_oid" name="other2_oid" value="0" />
					</div>
				</div>
				<div class="dt2">(<?=$product_unit?>)</div>
				<div class="sold hide"><?printf(WEB_ALREADY_SOLD,$item['sold_quantity']);?></div>
				</li>
				<!--
				<li id="choose-result" class="hide"><div class="dd"><em>已选择</em> <strong>“深空灰”</strong> <strong>“32G”</strong></div><div class="clear"></div></li>
				-->
				<li id="choose-btns">
					<div id="choose-btn-append" class="btn">
					<? $stock=$item['stock'];if($stock>0){ ?>
					<a onclick="add_to_cart();"><img src="<?=WEB_BUTTON_CART?>" /></a>
					<? }else{ ?>
					<div class="button_invalid"><?=WEB_OUT_STOCK?></div>
					<? } ?>
					<?
					if(AMAZON_LINK && !empty($item['name_tc'])) {
						$tmp=explode("-",$item['name_tc']);
					?>
					
					
					<a href="http://www.amazon.com/dp/<?=$tmp[0]?>/ref=aag_m_pw_dp?ie=UTF8&m=<?=$tmp[1]?>" target="_blank">&nbsp;&nbsp;&nbsp;<img height="60" src="<?=$ecom?>/images/buy_at_amazon.jpg"/></a>

					<?}?>
					<?if(EBAY_LINK && !empty($item['name_sc'])) {?>
					<a href="http://www.ebay.com/itm/<?=$item['name_sc']?>" target="_blank">&nbsp;&nbsp;&nbsp;<img height="60" src="<?=$ecom?>/images/buy_at_ebay.jpg"/></a>
					<?}?>
					</div>
			</li>
			</ul><!--choose end-->
            <div id="tags">
                <div id="tags_list"><span>标签：</span>
                    <?foreach($tag_info as $val_ti){?>
                        <a class="list_more" href="search.php?tag_id=<?=$val_ti['id']?>"><?=$val_ti['name_'.$lang]?></a>
                <?}?></div>
            </div>
			<div id="short_share">
				<div id="add_favor"><a onclick="add_to_wish('<?=$id?>')"><?=WEB_COLLECTION?></a></div>
				<div id="share"><span><?=WEB_SHARE_TO?>： </span>
					<?
					//// 简体中文加载百度分享, 其余语言加载addthis
					if($lang_id==2){ ?>
					<div id="share_list">
						<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="<?=WEB_SHARE_TO_QZONE?>"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="<?=WEB_SHARE_TO_SINA?>"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="<?=WEB_SHARE_TO_TQQ?>"></a><a href="#" class="bds_renren" data-cmd="renren" title="<?=WEB_SHARE_TO_RENREN?>"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="<?=WEB_SHARE_TO_WEIXIN?>"></a></div>
					</div>
					<? } else { ?>
					<div class="addthis_toolbox addthis_default_style ">
						<a class="addthis_button_preferred_1"></a>
						<a class="addthis_button_preferred_2"></a>
						<a class="addthis_button_preferred_3"></a>
						<a class="addthis_button_preferred_4"></a>
						<a class="addthis_button_compact"></a>
						<a class="addthis_counter addthis_bubble_style"></a>
					</div>
					<? } ?>
				<div class="clear"></div>
				</div>
			<div class="clear"></div>
			</div><!--short_share end-->
		</div><!--grid_middle end-->
	<div class="clear"></div>
	</div><!--product_intro end-->

	<?
	// releated items 相关产品
	if(count($arr_related)>0){
	?>
	<div class="px20"></div>
	<div id="hot">
		<div class="h2index"><h2 class="left"><a><?=WEB_RELATED_PRODUCTS?></a></h2><div class="clear"></div></div>
		<div class="cross">
			<div class="cross_one left">
				<div class="left cross_one_item"><img src="<?=PRODUCT_PIC_HOST.$item['small_pic']?>" /><br />
				<p class="pname"><a href="product-html"><?=str_cut($item['name_'.$lang],PRODUCT_TITLE_DISPLAY_LENGTH,$lang)?></p>
				<div class="price"><span><span><?=$currency_sign?></span><span class="item_price"><?=$product_price?></span></span></div>
			</div>
				<div class="clear"></div>
			</div>
			<div class="cross_more left">
				<?
				$str='';
				$k=0;
				$tem_num=count($arr_related);
				$cross_width = ($tem_num*140).'px';
				foreach ($arr_related as $key => $val) {
					$k++;
					$tem_link=seo_url($val['name_'.$lang]).'-p-'.$val['id'].'.html';
					$tem_pic=PRODUCT_PIC_HOST.$val['small_pic'];
					$tem_name=str_cut($val['name_'.$lang],PRODUCT_TITLE_DISPLAY_LENGTH,$lang);
					//$tem_price=round($val['price']*$currency_rate,2);
					$tem_price=price($val);
					if($k==$tem_num) $str.='<div class="crosser noicon">';
					else $str.='<div class="crosser">';
					$str.='
						<div class="left cross_icon"></div>
						<div class="right crosser_box">
						<div class="image"><a href="'.$tem_link.'"><img src="'.$tem_pic.'" /></a></div>
						<div class="pname"><a href="'.$tem_link.'">'.$tem_name.'</a></div>
						<div class="price"><label><input onclick="cross_buy(0)" type="checkbox" name="pid'.$val['id'].'" data="'.$val['id'].'" data-price="'.$tem_price.'" /> <span> <span>'.$currency_sign.'</span>'.$tem_price.'</span></label></div>
						</div>
						<div class="clear"></div>
					</div>';
				}
			?>
				<div class="cross_morer" style="width:<?=$cross_width?>"><?=$str?>
				<div class="clear"></div>
				</div>
			</div>
			<div class="cross_buy right"><div class="left cross_icon"></div>
			<div class="cross_buy_box right"><br />
				<?=WEB_CROSS_PRICE.': <span class="red bold f16">'.$currency_sign.'<span class="span_cross_price">'.$product_price.'</span></span>'; ?><br /><br />
				<a class="button_red" onclick="cross_buy(1)"><?=WEB_BUY_NOW?></a></div></div>
			<div class="clear"></div>
		</div>

	</div><!--# related-->
	<? } // releated items end ?>

	<div id="product_intro" class="bnone">
		<div class="area">
			<ul class="arealist">
				<?
				$i=0;
				if($option['product']['description_'.$lang]==1) {
					$desc_i=$i;
					$i++;
				}
				if($option['product']['feature_'.$lang]==1) {
					$feature_i=$i;
					$i++;
				}
				if($option['product']['spec_'.$lang]==1) {
					$spec_i=$i;
					$i++;
				}
				if(is_module_enabled($option_module['product_review'])) {
					$product_review_i=$i;
					$i++;
				}
				if($option['product']['other1_'.$lang]==1) {
					$other1_i=$i;
					$i++;
				}
				?>
			
			
				<?if(isset($desc_i)) {?>
				<li id="tli<?=$desc_i?>" onclick="tabs('tli', 'tdiv', <?=$i?>, <?=$desc_i?>)" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="1")?" class='h'":"")?>><a><?=WEB_PRODUCT_DESCRIPTION?></a></li>
				<?}?>
				<?if(isset($feature_i)) {?>
				<li id="tli<?=$feature_i?>" onclick="tabs('tli', 'tdiv', <?=$i?>, <?=$feature_i?>)" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="2")?" class='h'":"")?>><a><?=WEB_PRODUCT_FEATURE?></a></li>
				<?}?>
				<?if(isset($spec_i)) {?>
				<li id="tli<?=$spec_i?>" onclick="tabs('tli', 'tdiv', <?=$i?>, <?=$spec_i?>)" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="3")?" class='h'":"")?>><a><?=WEB_PRODUCT_SPEC?> </a></li>
				<?}?>
				<?if(isset($product_review_i)) {?>
				<li id="tli<?=$product_review_i?>" onclick="tabs('tli', 'tdiv', <?=$i?>, <?=$product_review_i?>)" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="4")?" class='h'":"")?>><a><?=WEB_PRODUCT_REVIEW?> <?printf(WEB_ALREADY_REVIEWED,$product_review_summary_obj['cnt']);?></a></li>
				<?}?>
				<?if(isset($other1_i)) {?>
				<li id="tli<?=$other1_i?>" onclick="tabs('tli', 'tdiv', <?=$i?>, <?=$other1_i?>)" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="5")?" class='h'":"")?>><a><?=WEB_PRODUCT_OTHER1?></a></li>
				<?}?>
			</ul>
			<div class="clear"></div>
			<?if(isset($desc_i)) {?>
			<div id="tdiv<?=$desc_i?>" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="1")?"":" class='hide'")?>>
				<div class="areatxt">
						<?=$item['description_'.$lang]?>
					<div class="clear"></div>
				</div>
			</div>
			<?}?>
			<?if(isset($feature_i)) {?>
			<div id="tdiv<?=$feature_i?>" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="2")?"":" class='hide'")?>>
				<div class="areatxt">
						<?=$item['feature_'.$lang]?>
					<div class="clear"></div>
				</div>
			</div>
			<?}?>
			
			<?if(isset($spec_i)) {?>
			<div id="tdiv<?=$spec_i?>" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="3")?"":" class='hide'")?>>
				<div class="areatxt">
						<?=$item['spec_'.$lang]?>
					<div class="clear"></div>
				</div>
			</div>
			<?}?>
			
			<?if(isset($product_review_i)) {?>
			<div id="tdiv<?=$product_review_i?>" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="4")?"":" class='hide'")?>/>
				<div class="areatxt">
				</div>
			</div>
			<?}?>
			<?if(isset($other1_i)) {?>
			<div id="tdiv<?=$other1_i?>" <?=(($config['PRODUCT_DEFAULT_DISPLAY']=="5")?"":" class='hide'")?>>
				<div class="areatxt">
						<?=$item['other1_'.$lang]?>
					</ul>
				</div>
			</div>
			<?}?>
		</div><!-- end area -->
	</div><!-- product_intro end -->

	<?
	// hot items 热销产品
	if(count($arr_hot)>0){
	?>
	<div class="px20"></div>
	<div id="hot">
		<div class="h2index"><h2 class="left"><a><?=WEB_HOT_ITEMS?></a></h2><div class="more right gray"><a href="category.html"><?=WEB_VIEW_MORE?>>></a></div><div class="clear"></div></div>
		<div class="hot">
			<ul class="hlist_fs">
				<?
						$str='';
						foreach ($arr_hot as $key => $val) {
							$tem_link=seo_url($val['name_'.$lang]).'-p-'.$val['id'].'.html';
							$tem_pic=PRODUCT_PIC_HOST.$val['small_pic'];
							$tem_name=str_cut($val['name_'.$lang],PRODUCT_TITLE_DISPLAY_LENGTH,$lang);
							//$tem_price=round($val['price']*$currency_rate,2);
							$tem_price=price($val).discount($val);
							$str.='<li class="hlist_li">
						<div class="hlist_f">
							<div class="hlist_pro">
								<div class="image"><a href="'.$tem_link.'"><img src="'.$tem_pic.'" width="'.PRODUCT_SMALL_PIC_WIDTH.'" height="'.PRODUCT_SMALL_PIC_HEIGHT.'" /></a></div>
								<div class="pname"><a href="'.$tem_link.'">'.$tem_name.'</a></div>
								<div class="price"><span><span>'.$currency_sign.'</span>'.$tem_price.'</span></div>
							</div>
						</div>
					</li>';
						}
						echo $str;
					?>
			</ul>
			<div class="clear"></div>
		</div>
	</div><!--# hot-->
	<? } // hot items end ?>
	
	
</div><!-- wrap end -->
<? include_once("footer.php"); ?>
<div class="center_box hide"><div class="center_wrap">
<div class="center_boxer">
	<div class="close right hand" onclick="$('.center_box').fadeOut();"></div>
	<div class="icon "><?=WEB_ADDED_TO_CART_SUCCESSFULLY?></div>
	<div class="clear"></div>
	<div class="px20"></div>
	<div><a class="icon2" href="cart.html"><?=WEB_TO_CHECKOUT?></a> &nbsp; &nbsp; &nbsp; <a class="font14px blue" onclick="$('.center_box').fadeOut();"><?=WEB_CONTINUE_SHOPPING?></a></div><div class="px20"></div>
	</div>
</div></div>
<script type="text/javascript">
$(function(){
	var $content1 = $(".scroller");
	var i1 = 4;
	var m1 = 4;
	var count1 = $content1.find(".minphoto").length;
	$(".next").click(function(){
		if( !$content1.is(":animated")){
			if(m1<count1){
				m1++;
				$content1.animate({left: "-=62"}, 180);
			}
			else {
			m1=count1;
			}
		}
	});
	$(".prev").click(function(){
		if( !$content1.is(":animated")){
			if(m1>i1){
				m1--;
				$content1.animate({left: "+=62"}, 180);
			}
			else {
			m1=i1;
			$content1.animate({left: "0"}, 380);
			}
		}
	});
});
// "立即购买"事件
$('.center_box').css('top',($(window).height())/2);
$('.center_box').css('left',($(window).width())/2-128);
function add_to_wish(id){
	$.get("ajax_wishlist.php",{'id':id,'do':'add'}, function(data){
		if(data=='1') $('#add_favor').html('<a class="red"><?=WEB_ADDED_TO_COLLECTION?></a>');
		if(data=='8') goto('login.html');
		$.notice('<?=WEB_ADDED_TO_COLLECTION?>');
		//alert(data);
    });
}
<?if(is_module_enabled($option_module['product_review'])) {?>
$("document").ready(function(){
	$.ajax({url:"product_review_ajax.php?pid=<?=$id?>",success:function(result){
		$("#tdiv<?=$product_review_i?> .areatxt").html(result);
	}});

});

function goToPage(page)
{
	$.ajax({
		type: "GET",
		url: "product_review_ajax.php",
		data: "page=" + page + "&pid=" + <?=$id?>,
		success: function(result){
			$("#tdiv<?=$product_review_i?>").html(result);
		}
	});
}
<?}?>
</script>
<?
// 简体中文加载百度分享, 其余语言加载addthis
if($lang_id==2){ ?>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<? } else { ?>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5365fc0b3a935128"></script>
<? } ?>
</body>
</html>